package com.sparrow.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sparrow.exception.SparrowException;

@RestController
public class HelloController {

	@RequestMapping("/hello")
	public String index(){
		return "hello World";
	}
	
	@RequestMapping("/myError")
	public String myError() throws Exception{
		throw new Exception("发生错误");
	}
	
	@RequestMapping("/json")
    public String json() throws SparrowException {
        throw new SparrowException("发生错误2");
    }
}
